package com.pojo;
import lombok.Data;
import java.io.Serializable;
@Data
public class FindBook implements Serializable,Comparable<FindBook> {
    private int id;
    private String bookName;
    private String author;
    private String mainSignature;
    private String signature2;
    private String profile;
    private Double score;
    private String signature3;
    private String signature4;
    private String signature5;
    private Long wordage;
    private Long addQuantity;

    private Long readQuantity;
    private String snopsis;
    private String bookImage;
    private String background;
    private Integer recommendQuantity;
    private String flag;
    @Override
    public int compareTo(FindBook o) {
        if("sortByHot".equals(flag)) {
            return this.readQuantity.compareTo(o.getReadQuantity());
        }else{
            return this.recommendQuantity.compareTo(o.getRecommendQuantity());
        }
    }
}
